package com.bawei.mvvm.http

import androidx.lifecycle.LiveData
import com.bawei.mvvm.entity.BannerData
import com.bawei.mvvm.entity.Goods
import com.bawei.mvvm.entity.User
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface ApiService {

    @GET(Const.BANNER_URL)
    fun getBanners(): LiveData<ApiResponse<MutableList<BannerData>>>


    @GET(Const.GOODS_URL)
    fun getGoods(@Query("category_id") category_id:Int, @Query("currentPage") currentPage:Int, @Query("pageSize") pageSize:Int):LiveData<ApiResponse<MutableList<Goods>>>

    @POST(Const.LOGIN_URL)
    fun login(@Body requestBody: RequestBody):LiveData<ApiResponse<User>>

}